home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 2.0 KB | 73 lines | [TEXT/ToyS] |
- property gasFriendlyUser : "CasaVision" -- Our friend on all machines
- property gasFriendlyPass : "" -- Our friend's password on all machines
- property gasFriendSet : false -- Has the friend been asked for?
-
- property kasAllowAlerts : true -- Set to false to stop warnings about missed servers
-
- property kasOurFolder : ":Remote Files:"
- -- property kasOurFolder : "◊LIFE◊:Abaton:Athena:Agents:osax:Akua Sweets Examples:Remote Launcher:Remote Files:" -- For testing
-
-
- on run
- GetFriend() -- Make sure we have a friendly user
-
- set myFolder to kasOurFolder
-
- set myFiles to list folder (myFolder as alias)
-
- repeat with f in myFiles
- open {alias (myFolder & f)}
- end repeat
- end run
-
-
- on open fsObjs
- repeat with f in fsObjs
- set myAlias to «event ÅkuFFiLA» f
- set myInfo to alias info from myAlias
- set myServer to alias server of myInfo
- set myZone to alias zone of myInfo
-
- talk as user gasFriendlyUser ¬
- with password gasFriendlyPass ¬
- on server myServer ¬
- in AppleTalk zone myZone
-
- try
- -- Don't wait for a response, assume the aliases are correct
- ignoring application responses
- tell application "Finder" of machine myServer of zone myZone to open myAlias
- end ignoring
- on error
- if (kasAllowAlerts) then
- ShowAlert("Couldn't link to Finder on " & myServer & " in zone " & myZone & ".")
- else
- beep
- end if
- end try
- end repeat
- end open
-
-
- on GetFriend()
- if not gasFriendSet then
- set chosen to display dialog ¬
- "Enter the friendly user's name…" default answer gasFriendlyUser default button 2 with icon stop
-
- if (the button returned of chosen is "OK") then ¬
- set gasFriendlyUser to the text returned of chosen
-
- set chosen to display dialog "Enter the friendly user's password…" default answer gasFriendlyPass default button 2 with icon stop
-
- if (the button returned of chosen is "OK") then ¬
- set gasFriendlyPass to the text returned of chosen
-
- set gasFriendSet to true
- end if
- end GetFriend
-
-
- on ShowAlert(msgStr)
- display dialog msgStr buttons {"Damn!"} default button 1
- end ShowAlert
-